*{

Pagination thingie, 
based on http://groups.google.com/group/play-framework/browse_thread/thread/32f9e6f5ff6152a6?pli=1

The main argument needs to be a paginationinfo object, 
use like #{pagination paginationInfo /}

Look at that class to see how it's members affect this output. 

Optional arguments: 
- id:       []   an id for the div wrapped around
- first:    [<<] label for the "first" link
- last:     [>>] label for the "last" link
- previous: [<]  label for the "previous" link
- next:     [>]  label for the "next" link
- radius:   [4]  how many pages to display left/right of the current page
- clazz:    []   additional css class for outer div, the "pagination" class is always added. 

}* 
<div class="pagination ${_clazz} wp-pagenavi" id="${_id}">
	<ul>
	%{ 
		def page = { 
			args = new java.util.HashMap<String, Object>() 
			args.put('page', it)
			//args.put('zip', params.get( "zip" ) )
			_arg.params.each{ p -> args.put( p, params.get( p ) ) }
			util.FsUtil.fullURL(_arg.staticUrl,_arg.action, args)
		}
		pageCount    = _arg.getNumPages();  
		first        = (_first == null || _first == '') ? '&laquo;' : _first; 
		previous     = (_previous == null || _previous == '') ? '&lsaquo;' : _previous; 
		next         = (_next == null || _next == '') ? '&rsaquo;' : _next; 
		last         = (_last == null || _last == '') ? '&raquo;' : _last;
		radius		 = (_radius == null )? 4 : _radius; 
		
		if (_arg.page == 1) { 
			out.println('<li class="prev disabled"><a href="#">&larr;  Trang trước</a></li>'); 
		} 
		
		if (_arg.page != 1) { 
			out.println('<li><a rel="1" href="' + page(1) +'">Trang đầu</a></li>'); 
			out.println('<li><a rel="' + (_arg.page-1) + '" href="' + page(_arg.page - 1) + '">&larr;  Trang trước</a></li>'); 
		} 
		for (int i = Math.max( 1, _arg.getPage() - radius ); i <= Math.min( pageCount, _arg.getPage() + radius ); i++) { 
			if (i != _arg.getPage() ){ 
				out.println('<li><a rel="' + i + '" href="' + page(i) + '">' + i + '</a></li>' ); 
			}
			else { 
				out.println('<li class="active"><a href="#">' + i + '</a></li>'); 
			} 
		}
	
		if (pageCount > 0 && _arg.page != pageCount) { 
			out.println('<li><a rel="' + i + '" href="' + page(_arg.getPage() + 1) + '">Trang tiếp theo  &rarr;</a></li>'); 
		}
		if (pageCount > 0 && _arg.page == pageCount) { 
			out.println('<li class="next disabled"><a href="#">Trang tiếp theo  &rarr;</a></li>'); 
		}
	}% 
	</ul>
</div>